﻿using System.Collections.Generic;

namespace Titan.WinFormSys.Entity
{
    /// <summary>
    /// 更新实体类
    /// </summary>
    public class ClinetUpdate
    {
        /// <summary>
        /// 更新请求类
        /// </summary>
        public class DasRspMsgClientUpdateCheck
        {
            /// <summary>
            /// 版本号
            /// </summary>
            public int VersionNum = 0;
            /// <summary>
            /// 文件列表
            /// </summary>
            public List<PatchFile> PatchFiles = null;
        }
        /// <summary>
        /// 下载实体类
        /// </summary>
        public class DasRspMsgClientUpdateDownload
        {
            /// <summary>
            /// 文件名称
            /// </summary>
            public string FileName = "";
            /// <summary>
            /// 文件MD5值
            /// </summary>
            public string FileMD5 = "";
            /// <summary>
            /// 是否需要解压
            /// </summary>
            public bool NeedUnzip = false;
            /// <summary>
            /// 文件类容 
            /// </summary>
            public byte[] FileContent = null;
        }
        /// <summary>
        /// 压缩文件
        /// </summary>
        public class PatchFile
        {
            /// <summary>
            /// 文件名称
            /// </summary>
            public string FileName;
            /// <summary>
            /// 是否需要解压
            /// </summary>
            public bool NeedUnzip;
            /// <summary>
            /// 默认构造函数
            /// </summary>
            /// <param name="fileName">文件名称</param>
            /// <param name="needUnzip">是否解压</param>
            public PatchFile(string fileName, bool needUnzip)
            {
                FileName = fileName;
                NeedUnzip = needUnzip;
            }
        }
    }
}
